<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>报名系统 - 江西农业大学大学生软件设计大赛</title>

<!-- Bootstrap core CSS -->
<link href="${base}/assets/libs/bootstrap/3.3.7/css/bootstrap.css"
	rel="stylesheet">

</head>
<body role="document">
	<input type="hidden" id="base" value="${base}">
	<!-- Fixed navbar -->
	<nav class="navbar navbar-inverse navbar-fixed-top">
		<div class="container">
			<div id="navbar" class="navbar-collapse collapse">
				<ul class="nav navbar-nav">
					<li class="active"><a href="#">首 页</a></li>
					<!--<li><a href="#about">报名流程</a></li>-->
					<!--<li><a href="#contact">注册队伍</a></li>-->
					<li><a href="${base}/logout">注销</a></li>
				</ul>
			</div>
			<!--/.nav-collapse -->
		</div>
	</nav>
	<div class="container theme-showcase" role="main">
		<div class="row">
			<div class="col-md-2 sidebar">
				<ul class="nav nav-pills nav-stacked" id="admin-nav">
					<br />
					<br />
					<br />
					<br />
					<br />
					<br />
					<br />
					<br />
					<br />
					<li role="presentation" class="active"><a href="">报名信息</a></li>
					<li role="presentation"><a onclick="javascript:showAlert()"
						href="${base}/user/worksSubmit">提交作品</a></li>
				</ul>
			</div>
			<div class="col-md-10">
				<div class="page-header">
					<br /> <br />
					<h2>个人信息</h2>
				</div>
				<div class="row">
					<div class="col-md-4">
						<table class="table table-bordered">
							<tr>
								<th class="info">邮箱</th>
								<td>${user_session.user.email }</td>
							</tr>
							<tr>
								<th class="info">联系电话</th>
								<td>${user_session.user.tel }</td>
							</tr>
							<tr>
								<th class="info">姓名</th>
								<td>${user_session.user.userName }</td>
							</tr>
							<tr>
								<th class="info">性别</th>
								<td>
								<#if user_session.user.sex==1>男
									<#elseif user_session.user.sex==0>女
									<#else>保密
								</#if>
								</td>
								
							</tr>
							<tr>
								<th class="info">院系</th>
								<td>${user_session.user.academy }</td>
							</tr>
							<tr>
								<th class="info">专业</th>
								<td>${user_session.user.major }</td>
							</tr>
							<tr>
								<th class="info">班级</th>
								<td>${user_session.user.classs }</td>
							</tr>
							<tr>
								<th class="info">学号</th>
								<td>${user_session.user.studentNumber }</td>
							</tr>
							<tr>
								<th class="info">入学年份</th>
								<td>${user_session.user.startyear }</td>
							</tr>
						</table>
						<a class="btn btn-primary"
							href="${base}/user/userView"
							role="button">修改信息</a> <a class="btn btn-info"
							href="${base}/view/modifyPassword" role="button">修改密码</a>
					</div>
				</div>
				<div class="page-header">
					<h2>团队信息</h2>
				</div>
				<table class="table table-bordered">
					<tr>
						<th></th>
						<th>姓名</th>
						<th>院系</th>
						<th>专业</th>
						<th>班级</th>
						<th>电话</th>
						<!-- <th>邮箱</th> -->
						<th>操作</th>
					</tr>
					<tr>
						<td>队长</td>
						<td>${user_session.user.userName }</td>
						<td>${user_session.user.academy }</td>
						<td>${user_session.user.major }</td>
						<td>${user_session.user.classs }</td>
						<td>${user_session.user.tel }</td>
						<td>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <a role="button"
							class="btn btn-primary"
							href="${base}/view/memberInfo">添加队员</a>
						</td>
					</tr>
					<#list user_session.members as member>
					<#if member.memberRole==0>
					<tr>
						<td>队员${member_index+1}</td>
						<td>${member.memberName }</td>
						<td>${member.memberAcademy }</td>
						<td>${member.memberMajor }</td>
						<td>${member.memberClasss }</td>
						<td>${member.memberTel }</td>
						<td>&nbsp; <a class="btn btn-warning" role="button" href="${base}/member/queryMember/${member.memberId}">修改</a>
							&nbsp;|&nbsp; <button class="btn btn-danger" id="removeMember" title="${member.memberId}">删除</button>
						</td>
					</tr>
					</#if>
					</#list>
					<tr>
						<td>指导老师</td>
						<#list user_session.members as teacher>
							<#if teacher.memberRole==1>
								<td>${teacher.memberName }</td>
								<td>${teacher.memberAcademy }</td>
								<td>
								<td>
								<td>
								<td>&nbsp; <a class="btn btn-warning" data-target="#addTeacher" type="button"  data-toggle="modal">修改</a>
									&nbsp;|&nbsp; <button type="button" class="btn btn-danger" id="removeTeacher" title="${teacher.memberId}">删除</button>
								</td>
								<#break>
							</#if>
							<#if user_session.members?size == teacher_index+1 >
								<td>
								<td>
								<td>
								<td>
								<td>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
								<td class="text-center">
								<!-- <input type="hidden" name="memberRole" value=""> -->
								<a class="btn btn-primary" data-target="#addTeacher" type="button"  data-toggle="modal">添加</a></td>
							</#if>
						</#list>
						<#if user_session.members?size == 0>
								<td>
								<td>
								<td>
								<td>
								<td>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
								<td class="text-center">
								<!-- <input type="hidden" name="memberRole" value=""> -->
								<a class="btn btn-primary" data-target="#addTeacher" type="button"  data-toggle="modal">添加</a></td>
						</#if>						
					</tr>
				</table>
				<button class="btn btn-primary" id="signUp">报名大赛</button>
				
			</div>
		</div>
		
		<!--添加指导老师-->
        <div class="modal fade" id="addTeacher" tabindex="-1" role="dialog"
            aria-labelledby="myModalLabel">
            <div class="modal-dialog" role="document">
                <div class="modal-content">
                    <div class="modal-header">
                        <button type="button" class="close" data-dismiss="modal"
                            aria-label="Close">
                            <span aria-hidden="true">&times;</span>
                        </button>
                        <h4 class="modal-title" id="myModalLabel"
                            style="color: #6a6a6a; align-items: center;">添加指导老师</h4>
                    </div>
                    <div class="modal-body">
                        <div class="container">
    
                            <form class="form-horizontal">
                                <div class="form-group">
                                    <label for="inputEmail3" class="col-sm-1 control-label">姓名</label>
                                    <div class="col-sm-3">
                                        <input type="text" class="form-control" id="teacherName"
                                            autocomplete="off" value="${user_session.member.memberName }">
                                            <span style="color: red; font-weight: 500" id="teacherNameSpan"></span>
                                    </div>
                                </div><br/>
                                <div class="form-group">
                                    <label for="inputEmail3" class="col-sm-1 control-label">院系</label>
                                    <div class="col-sm-3">
                                        <input type="text" class="form-control" id="teacherAcademy"
                                            autocomplete="off" value="${user_session.member.memberAcademy }">
                                            <span style="color: red; font-weight: 500" id="teacherAcademySpan"></span>
    
                                    </div>
                                </div>
                                <input type="hidden" id="memberRole" value="1">
                                <input type="hidden" id="memberId" value="${user_session.member.memberId }">
                        </div>
                    </div>
                    <div class="modal-footer">
                        <button type="button" class="btn btn-default" data-dismiss="modal">取消</button>
                        <button type="button" class="btn btn-primary" id="goAddTeacher">确定</button>
                    </div>
                    </form>
                </div>
            </div>
        </div>
	</div>
	<script type="text/javascript"
		src="${base}/assets/libs/jquery/1.12.4/jquery.js"></script>
	<script type="text/javascript"
		src="${base}/assets/libs/bootstrap/3.3.7/js/bootstrap.js"></script>
	<script type="text/javascript"
		src="${base}/assets/js/userInfo.js"></script>
</body>
</html>